package cn.com.tuns.assess.qsb.frame.widget.dialog;

import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager.LayoutParams;
import android.widget.LinearLayout;
import cn.com.tuns.assess.qsb.R;
import cn.com.tuns.assess.qsb.frame.util.DimenUtils;


public class BottomDialog extends Dialog implements OnClickListener {

	private LinearLayout mContentLayout;

	public BottomDialog(Context context) {
		super(context);
		dialogInit(context);
	}

	public BottomDialog(Context context, int theme) {
		super(context, theme);
		dialogInit(context);
	}

	private void dialogInit(Context context) {
		mContentLayout = new LinearLayout(context);
		mContentLayout.setOrientation(LinearLayout.VERTICAL);
		mContentLayout.setBackgroundColor(0xfff6f6f6);
		setContentView(mContentLayout);
		LayoutParams lp = getWindow().getAttributes();
		lp.gravity = Gravity.BOTTOM;
		lp.width = DimenUtils.getWindowWidth(getWindow());
		lp.windowAnimations = R.style.BottomWindowAnimation;
		dialogInit();
	}

	public void dialogInit() {

	}

	public LinearLayout getContentlLayout() {
		return mContentLayout;
	}

	public void show(View view) {
		// showAtLocation(view, Gravity.BOTTOM, 0, 0);
		show();
	}

}
